﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Testing;
using ProtoImaginer.ProtoProject;
using ProtoImaginer.Models;


namespace ProtoUnitTest
{
    public partial class MainPage : PhoneApplicationPage
    {
        // Constructor
        public MainPage()
        {
            InitializeComponent();
            this.Content = UnitTestSystem.CreateTestPage(); 
        }
        private const string strConnectionString = @"isostore:/protoDataContext.sdf";
        
        public static int AddIntegers(int a, int b)
        {
            return (a + b);
        }
        public static Boolean AddProjectIntoDB()
        {
            Project temp = new Project("UNIT TEST", "test", "00.jpg");
            String id = temp.ProjectId;
            IList<Project> RecordList = new List<Project>();
            ProtoDataContext database = new ProtoDataContext(strConnectionString);
            //ProtoImaginer.Models.ProtoDataContext.AddProject(temp);
            IQueryable<Project> query = from pjt in database.Projects where pjt.ProjectId == id select pjt;
            //RecordList = query.ToList();
            RecordList.Add(temp);
            return (RecordList!=null);
        }
    }
}